<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<style type="text/css">

body{ background:#EEEEEE;margin:0; padding:0; font-family:"微软雅黑", Arial, Helvetica, sans-serif; }

a{ color:#006600; text-decoration:none;}

a:hover{color:#990000;}

.top{ margin:5px auto; color:#990000; text-align:center;}

.info select{ border:1px #993300 solid; background:#FFFFFF;}

.info{ margin:5px; text-align:center;}

.info #show{ color:#3399FF; }

.bottom{ text-align:right; font-size:12px; color:#CCCCCC; width:1000px;}

</style>

</head>

<body>
<link rel="stylesheet" href="__PUBLIC__/css/pintuer.css">
<link rel="stylesheet" href="__PUBLIC__/css/admin.css">
<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/js/pintuer.js"></script>
</head>
<body>
<form method="post" action="" id="listform">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">

        <li>
          <select id="s_province" name="s_province" class="input" onchange="changesearch()" style="width:100px; line-height:17px; display:inline-block">
          </select>
          <select id="s_city" name="s_city"  class="input" onchange="changesearch()"  style="width:100px; line-height:17px;display:inline-block">  
          </select>
          <select id="s_county" name="s_county" class="input" change="changesearch()"  style="width:100px; line-height:17px;display:inline-block">
          </select>
        </li>
        <script class="resources library" src="__PUBLIC__/area.js" type="text/javascript"></script>

    

    <script type="text/javascript">_init_area();</script>
     <div id="show"></div>
    <script type="text/javascript">

        var Gid  = document.getElementById ;

        var showArea = function(){

          Gid('show').innerHTML = "<h3>省" + Gid('s_province').value + " - 市" +  

          Gid('s_city').value + " - 县/区" + 

          Gid('s_county').value + "</h3>"

                      }



        $("#s_county").change(function (){
            function timetrans(date){
                var date = new Date(date*1000);//如果date为13位不需要乘1000
                var Y = date.getFullYear() + '-';
                var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
                var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
                var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
                var m = (date.getMinutes() <10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
                var s = (date.getSeconds() <10 ? '0' + date.getSeconds() : date.getSeconds());
                return Y+M+D+h+m+s;
            }
            var s_province= $('#s_province').val();
            var s_city =$('#s_city').val();
            var s_county = $('#s_county').val();
            console.log(s_province,s_city,s_county)
            $.ajax({
                type: 'POST',
                dataType: 'json',
                url: '__CONTROLLER__/seach',
                data:{
                    s_province:s_province,
                    s_city:s_city,
                    s_county:s_county
                },
                success:function (data) {

                    $("#tbody").empty();
                    var tr='';
                    for(var i=0; i<data.length;i++){
                        var html4=timetrans(data[i].addtime)
                        var html5=timetrans(data[i].shtime)
                        if(data[i].bstatus==0){
                            var html1='<font color="#00CC99">未中标</font>'
                        }else{
                            var html1='<font color="#00CC99">已中标</font>'
                        }
                        if(data[i].shstatus==0){
                            var html2='<font color="#00CC99">未审核</font>'
                        }else{
                            var html2='<font color="#00CC99">已审核</font>'
                        }
                        if(data[i].rebacktime==null){
                            var html3='未回访'
                        }else{
                            var html3=timetrans(data[i].rebacktime)
                        }
                        var id=data[i].id
                        var html6='<a class="button border-main" href="__MODULE__/Zhaobiao/update?id=id"><span class="icon-edit"></span>修改</a><a class="button border-red" href="javascript:void(0)" onclick="del('+id+')"><span class="icon-trash-o"></span>删除</a>'

                        tr+='<tr><td style="text-align:center;padding-left:20px;">'+data[i].id+'</td><td>'+data[i].s_province+data[i].s_city+data[i].s_county+'</td>' +
                            '<td><a href="">'+data[i].comm+'</a><br/> <span>标号:12546946544</span></br> <span>发布时间:'+html4+'</span></br> <span>审核时间:'+html5+'</span></br> </td><td>'+html3+'</td> <td><font color="#00CC99">自主上传</font></td> <td>PC</td> <td>'+html1+'</td> <td>'+html2+'</td><td>'+data[i].ip+'</td> <td>'+data[i].operator+'</td> <td><div class="button-group">'+html6+'</div></td></tr>;'

                    }
                    $('#tbody').append(tr);//追加到你需要放在的位置
                }
            });
        })
    </script>
        <li>审核状态:</li>
          <li>
            <select id="cid" name="shstatus" class="input" style="width:70px; line-height:17px;" change="change()">
              <option value="">请选择</option>
              <option value="1">已审核</option>
              <option value="0">未审核</option>
            </select>
          </li>
        <script>
            $("#cid").change(function (){
                function timetrans(date){
                    var date = new Date(date*1000);//如果date为13位不需要乘1000
                    var Y = date.getFullYear() + '-';
                    var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
                    var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
                    var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
                    var m = (date.getMinutes() <10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
                    var s = (date.getSeconds() <10 ? '0' + date.getSeconds() : date.getSeconds());
                    return Y+M+D+h+m+s;
                }
                var shstatus = $('#cid').val();
                $.ajax({
                    type: 'POST',
                    dataType: 'json',
                    url: '__CONTROLLER__/shchaxun',
                    data:{shstatus:shstatus},
                    success:function (data) {



                        $("#tbody").empty();
                        var tr='';
                        for(var i=0; i<data.length;i++){
                            var html4=timetrans(data[i].addtime)
                            var html5=timetrans(data[i].shtime)
                            if(data[i].bstatus==0){
                                var html1='<font color="#00CC99">未中标</font>'
                            }else{
                                var html1='<font color="#00CC99">已中标</font>'
                            }
                            if(data[i].shstatus==0){
                                var html2='<font color="#00CC99">未审核</font>'
                            }else{
                                var html2='<font color="#00CC99">已审核</font>'
                            }
                            if(data[i].rebacktime==null){
                                var html3='未回访'
                            }else{
                                var html3=timetrans(data[i].rebacktime)
                            }
                            var id=data[i].id
                            var html6='<a class="button border-main" href="__MODULE__/Zhaobiao/update?id=id"><span class="icon-edit"></span>修改</a><a class="button border-red" href="javascript:void(0)" onclick="del('+id+')"><span class="icon-trash-o"></span>删除</a>'

                            tr+='<tr><td style="text-align:center;padding-left:20px;">'+data[i].id+'</td><td>'+data[i].s_province+data[i].s_city+data[i].s_county+'</td>' +
                                '<td><a href="">'+data[i].comm+'</a><br/> <span>标号:12546946544</span></br> <span>发布时间:'+html4+'</span></br> <span>审核时间:'+html5+'</span></br> </td><td>'+html3+'</td> <td><font color="#00CC99">自主上传</font></td> <td>PC</td> <td>'+html1+'</td> <td>'+html2+'</td><td>'+data[i].ip+'</td> <td>'+data[i].operator+'</td> <td><div class="button-group">'+html6+'</div></td></tr>;'

                        }
                        $('#tbody').append(tr);//追加到你需要放在的位置
                    }
                });
            })

        </script>
          <li>中标状态:</li>
          <li>
            <select id="bid" name="bstatus" class="input" style="width:70px; line-height:17px;" change="changesearch()">
              <option value="">请选择</option>
              <option value="1">已中标</option>
              <option value="0">未中标</option>
            </select>
          </li>
        <script>
            function timetrans(date){
                var date = new Date(date*1000);//如果date为13位不需要乘1000
                var Y = date.getFullYear() + '-';
                var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
                var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
                var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
                var m = (date.getMinutes() <10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
                var s = (date.getSeconds() <10 ? '0' + date.getSeconds() : date.getSeconds());
                return Y+M+D+h+m+s;
            }


            $("#bid").change(function (){
               var bstatus = $('#bid').val();
                console.log(bid)
                $.ajax({
                    type: 'POST',
                    dataType: 'json',
                    url: '__CONTROLLER__/schaxun',
                    data:{bstatus:bstatus},
                    success:function (data) {
                     $("#tbody").empty();
                        var tr='';
                        for(var i=0; i<data.length;i++){
                            var html4=timetrans(data[i].addtime)
                            var html5=timetrans(data[i].shtime)
                            if(data[i].bstatus==0){
                                var html1='<font color="#00CC99">未中标</font>'
                            }else{
                                var html1='<font color="#00CC99">已中标</font>'
                            }
                            if(data[i].shstatus==0){
                                var html2='<font color="#00CC99">未审核</font>'
                            }else{
                                var html2='<font color="#00CC99">已审核</font>'
                            }
                            if(data[i].rebacktime==null){
                                var html3='未回访'
                            }else{
                                var html3=timetrans(data[i].rebacktime)
                            }
                            var id=data[i].id
                            var html6='<a class="button border-main" href="__MODULE__/Zhaobiao/update?id=id"><span class="icon-edit"></span>修改</a><a class="button border-red" href="javascript:void(0)" onclick="del('+id+')"><span class="icon-trash-o"></span>删除</a>'

                            tr+='<tr><td style="text-align:center;padding-left:20px;">'+data[i].id+'</td><td>'+data[i].s_province+data[i].s_city+data[i].s_county+'</td>' +
                                '<td><a href="">'+data[i].comm+'</a><br/> <span>标号:12546946544</span></br> <span>发布时间:'+html4+'</span></br> <span>审核时间:'+html5+'</span></br> </td><td>'+html3+'</td> <td><font color="#00CC99">自主上传</font></td> <td>PC</td> <td>'+html1+'</td> <td>'+html2+'</td><td>'+data[i].ip+'</td> <td>'+data[i].operator+'</td> <td><div class="button-group">'+html6+'</div></td></tr>;'
                        }
                        $('#tbody').append(tr);//追加到你需要放在的位置
                    }
                });
            })

        </script>

        <li>
          <input type="text" placeholder="请输入搜索关键字" name="keywords" class="input" style="width:250px; line-height:17px;display:inline-block" id="keywords"/>
          <a href="javascript:void(0)" class="button border-main icon-search" id="sec"> 搜索</a>
        </li>
        <script>
          $("#sec").click(function(){
              var keyword = $("#keywords").val();
              $.ajax({
                  type:'POST',
                  dataType:'json',
                  url: '__CONTROLLER__/seachs',
                  data:{keyword:keyword},
                  success:function (data) {
                      $("#tbody").empty();
                      var tr='';
                      for(var i=0; i<data.length;i++){
                          var html4=timetrans(data[i].addtime)
                          var html5=timetrans(data[i].shtime)
                          if(data[i].bstatus==0){
                              var html1='<font color="#00CC99">未中标</font>'
                          }else{
                              var html1='<font color="#00CC99">已中标</font>'
                          }
                          if(data[i].shstatus==0){
                              var html2='<font color="#00CC99">未审核</font>'
                          }else{
                              var html2='<font color="#00CC99">已审核</font>'
                          }
                          if(data[i].rebacktime==null){
                              var html3='未回访'
                          }else{
                              var html3=timetrans(data[i].rebacktime)
                          }
                          var id=data[i].id
                          var html6='<a class="button border-main" href="__MODULE__/Zhaobiao/update?id=id"><span class="icon-edit"></span>修改</a><a class="button border-red" href="javascript:void(0)" onclick="del('+id+')"><span class="icon-trash-o"></span>删除</a>'

                          tr+='<tr><td style="text-align:center;padding-left:20px;">'+data[i].id+'</td><td>'+data[i].s_province+data[i].s_city+data[i].s_county+'</td>' +
                              '<td><a href="">'+data[i].comm+'</a><br/> <span>标号:12546946544</span></br> <span>发布时间:'+html4+'</span></br> <span>审核时间:'+html5+'</span></br> </td><td>'+html3+'</td> <td><font color="#00CC99">自主上传</font></td> <td>PC</td> <td>'+html1+'</td> <td>'+html2+'</td><td>'+data[i].ip+'</td> <td>'+data[i].operator+'</td> <td><div class="button-group"></div></td> </tr>;'

                      }
                      $('#tbody').append(tr);//追加到你需要放在的位置
                  }
              });
          })


        </script>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th>ID</th>
        <th>城市</th>
        <th>招标信息</th>
        <th>回访时间</th>
        <th>备注</th>
        <th>类型</th>
        <th>中标</th>
        <th>审核</th>
        <th>IP</th>
        <th>操作员</th>
        <th>操作</th>
      </tr>
      <tbody id="tbody">
      <foreach name="arr" item="v">

        <tr>
          <td style="text-align:center; padding-left:20px;">{$v.id}</td>
          <td>{$v.s_province}{$v.s_city}{$v.s_county}</td>
          <td width="10%">
          	<a href="">{$v.comm}{$v.area}㎡</a><br>
          	<span>标号：123456789101</span><br/>
			<span>发布时间：<?php echo date("Y-m-d H:i:s",$v['addtime'])?></span><br>
			<span>审核时间：<?php if($v['shstatus']==1){
							echo date("Y-m-d H:i:s",$v['shtime']);}else{
								echo "未审核";
							}
				?></span><br>
          </td>
          <td><?php if($v['rebacktime']==NULL){echo "未回访";}else{ echo date("Y-m-d H:i:s",$v["rebacktime"]);}?></td>
          <td><font color="#00CC99">{$v.beizhu};</font></td>
          <td>PC</td>
          <td><font color="#00CC99">{$v['bstatus']==1?'已中标':'未中标'}</font></td>
          <td><font color="#00CC99">{$v['shstatus']==1?'已审核':'未审核'}</font></td>
          <td>{$v.ip}</td>
          <td>{$v.operator}</td>
          <td><div class="button-group">
            <?php if($_SESSION['status']==1){?>
            <a class="button border-main" href="<?=U("Zhaobiao/update",array('id'=>$v['id']));?>"><span class="icon-edit"></span> 修改</a>
            <a class="button border-red" href="javascript:void(0)" onclick="del(<?php echo $v['id']?>)"><span class="icon-trash-o"></span>删除</a>
            <?php }else{ ?>
          你无权操作
          <?php }?>
  </div></td>
        </tr>



        </foreach>
      </tbody>
     	 <tr>
        <td colspan="11"><div class="pagelist"> {$pageStr} </div></td>
      </tr>
    </table>
  </div>
</form>
<script type="text/javascript">

//单个删除
function del(id){

	var title = window.confirm('您确定要删除此条数据么？')
	if(title){
		$.ajax({
			type:'post',
			url:'__CONTROLLER__/del',
			data:{id:id},
			success:function(){
				window.location.reload()
			},
			
		})
	}else{

	}
}



</script>
</body>
</html>